package com.company.huisuo.biz.dialog

import android.app.Activity
import androidx.recyclerview.widget.LinearLayoutManager
import com.company.huisuo.R
import com.company.huisuo.base.BaseCenterPopupView
import com.company.huisuo.biz.activity.FeedBackActivity
import com.company.huisuo.biz.adapter.DanceBookingAdapter
import com.company.huisuo.databinding.DialogDanceBookingBinding


class DanceBookingDialog(activity: Activity) : BaseCenterPopupView<DialogDanceBookingBinding>(
    activity
) {
    private val mAdapter by lazy {
        DanceBookingAdapter()
    }

    override val getLayoutId: Int
        get() = R.layout.dialog_dance_booking

    override val getViewBinding: DialogDanceBookingBinding
        get() = DialogDanceBookingBinding.bind(contentView)

    override fun initData() {
        mBinding.rcvList.apply {
            layoutManager = LinearLayoutManager(activity)
            adapter = mAdapter
        }
        mAdapter.addOnItemChildClickListener(R.id.tv_feedback) { adapter, view, pos ->
            //反馈
            FeedBackActivity.start(activity)
        }
        mBinding.ivClose.setOnClickListener {
            dismiss()
        }

        mAdapter.submitList(arrayListOf(0, 1, 2))
    }
}